#ifndef _ui_H_
#define _ui_H_

#include "User.h"

#define menu_num_max 5
#define menu_page_max 3

#define menu_roll 1
#define menu_turn 0

#define menu_back 2
#define menu_sure 3

#define HIGH_FREQ 1
#define LOW_FREQ 0

#define IN 1
#define OUT 0

class UI{

    public:

    void refresh();
    
    void data_refresh_move_in();
    void data_refresh_move_out();
    void show_icon_in();
    void show_icon_out();

    void Rssi_refresh(u8 dat);
    void set_cpu_freq(u8 mode);
    void factory();

    
    s8 son_moon_x = 0;
    bool son_moon_mode = 1;
    u8 wea_updata_flg;
    u8 sleep_hour;
    u8 wake_hour;

    u8 night_shutdown_flg;

    u8 night_dis_t = 0;

    u8 shutdown_flg = 0;
    u8 sys_wake_flg = 1;

    u8 menu_page = 0;

    u8 led_color_set_flg = 0;

    bool menu_page_return_flg = 0;

    u8 rssi_show_mode = 0; //0:rssi 1:battery

    


    

    
    private:
    s8 wea_x = 36;//运动云朵位置方向计时
    u8 wea_y = 38;
    u8 wea_mode = 0;
    u8 wea_t = 0;
    
    
    u8 time_updata_flg = 0;
    u8 love_flg = 1;
    u16 icon_flg  = 0;

    

    u8 oled_clr_flg  = 0;

    s8 menu_num = 0;

    u8 set_menu_num = 0;
    u8 set_dat_num = 0;
    u8 set_dat_num_max = 2;

    u8 set_menu_num_max = 2;
    u8 choose_menu_num = 3;

    s8 future_weather_text_x[3];



    void icon_set(u16 icon);
    void show_week(u8 x);
    void show_icon();
    void love_show();
    void show_love();
    void shutdown();
    void wake();
    void data_updata();
    void sys_work_set();
    void key_set();
    void clr();

    void menu_choose(u8 able,u8 mode);
    bool page_switch(u8 mode);
    
    void button(u8 mode);
    const char *get_munu_icon(u8 num);
    void show_switch(short x,short y,u8 persent);
    void turn_switch(short x,short y,u8 mode);
    void circle_move(u8 circle,u8 mode);
    void led_color_set();

    void led_color_ch(short x,u8 mode);
    void led_color_ch_move();
    void color_mix_circle(short x);
    void color_mix_circle_move(u8 mode);
    void location_ap_get();
    void sleep_wake_hour_move();
    void show_future_weather();
    void future_text_move();


    
};

extern UI ui;

extern u8 wea_ui_flg;
extern u8 high_freq_flg;


#endif